import { ApiProperty } from '@nestjs/swagger';
import { IsEmail, IsNotEmpty, Min } from 'class-validator';

export class UpdatePasswordDto {
  @IsNotEmpty({ message: '用户名不得为空' })
  @ApiProperty()
  username: string;
  @IsNotEmpty({ message: '密码不得为空' })
  @Min(6, { message: '密码不得低于6位' })
  @ApiProperty()
  password: string;

  @IsNotEmpty({ message: '邮箱不得为空' })
  @IsEmail({}, { message: '不是合法的邮箱' })
  @ApiProperty()
  email: string;

  @IsNotEmpty({ message: '验证码不得为空' })
  @ApiProperty()
  captcha: string;
}
